package com.hk.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/freemarker")
public class FreemarkerController {

    @GetMapping("simple")
    public ModelAndView index(){
        ModelAndView mv=new ModelAndView("hello.html");//模板文件的名称，不需要指定后缀
        mv.addObject("name","hello freemaker");
        mv.addObject("ss","kwkwk");
        return mv;
    }
}
